#include "mainwindow.h"

#include <QDebug>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
{
    setObjectName("mainWindow");
    setWindowTitle("zy Chart");
    //固定窗口大小
    setFixedSize(300, 500);

    m_loginDialog = new LoginDialog(this);
    //设置成无边框
    m_loginDialog->setWindowFlags(Qt::FramelessWindowHint | Qt::CustomizeWindowHint);
    setCentralWidget(m_loginDialog);

    m_registerDialog = new RegisterDialog(this);
    m_registerDialog->setWindowFlags(Qt::FramelessWindowHint | Qt::CustomizeWindowHint);
    m_registerDialog->hide();

    connect(m_loginDialog, &LoginDialog::signSwitchRegister, this, [this]() {
        setCentralWidget(m_registerDialog);
        m_loginDialog->hide();
        m_registerDialog->show();
    });
}
